package com.ctrip.payment.test.ngtest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.Test;

import java.util.concurrent.TimeUnit;

public class NGTestDependsOnMethods {

    private static final Logger logger = LoggerFactory.getLogger(NGTestDependsOnMethods.class);

    private String uid;
    @Test
    public void getUid() throws Exception {
        uid = "12504";
        logger.info("getUid, thread name = {}", Thread.currentThread().getName());
        TimeUnit.MILLISECONDS.sleep(1000);
    }

    @Test(dependsOnMethods = {"getUid"})
    public void getRoomList() throws Exception {
        logger.info("getRoomList, uid = {}, thread name = {}", uid, Thread.currentThread().getName());
        TimeUnit.MILLISECONDS.sleep(1000);
    }

    @Test(dependsOnMethods = {"getRoomList"})
    public void doBook() {
        logger.info("getRoomList, thread name = {}", Thread.currentThread().getName());
    }
}
